<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<div class="panel panel-default">
	<div class="panel-heading">
		<ul class="nav nav-pills nav-justified" role="tablist">
			<li role="presentation" class="<c:if test="${tab eq 'topic'}">active</c:if>"><a href="${ctx}/memberCenter/publish?tab=topic">话题</a></li>
			<li role="presentation" class="<c:if test="${tab eq 'reply'}">active</c:if>"><a href="${ctx}/memberCenter/publish?tab=reply">回复</a></li>
		</ul>
	</div>
	<div class="panel-body">
	 	<c:if test="${tab eq 'topic'}">
		 	<c:forEach items="${topicPage.getList()}" var="topic">
			<div class="media">
				<div class="media-left">
					<img onerror="this.src='${ctx}/static/imgs/avatar.jpg'" src="${topic.member.avatar}" class="avatar">
				</div>
				<div class="media-body">
					<a style="color: #333" class="title" href="${ctx}/topic/${topic.id}">
						<h5 class="media-heading">${topic.title}</h5>
					</a>
					<small style="color: #666">${topic.formatDate(topic.createTime)}</small>
				</div>
			</div>
			</c:forEach>
		</c:if>
		
		<c:if test="${tab eq 'reply'}">
			<c:forEach items="${replyPage.getList()}" var="reply">
				<div class="media">
					<div class="media-left">
						<img onerror="this.src='${ctx}/static/imgs/avatar.jpg'" src="${reply.fromMember.avatar}" class="avatar">
					</div>
					<div class="media-body">
						<small style="color: #666">${reply.formatDate(reply.createTime)}</small>
						<a style="color: #333;word-break: break-all;" class="title" href="${ctx}/topic/${reply.topicId}">
							${reply.markedownToHtml(reply.content)}
						</a>
					</div>
				</div>
			</c:forEach>
		</c:if>
	</div>
</div>